<template>
  <div>
    <h1>购物车</h1>
    <input type="text">
  </div>
</template>

<script>


export default {
  name: "cart",

  // keepAlive 会产生俩个生命周期
  // keepAlive后 除首次进入组件后 组件被缓存
  // 缓存后再次进入组件 触发activated 离开组件触发deactivated
  activated () { //组件激活 组件进入
    console.log("进入组件")
  },
  deactivated () {//离开组件
    console.log("离开组件")
  },
  beforeCreate () {
    console.log("创建前")
  },
  created () {
    console.log("创建后")
  },
  beforeMount () {
    console.log("挂载前")
  },
  mounted () {
    console.log("挂载后")
  },
  beforeDestroy () {
    console.log("销毁前")
  },
  destroyed () {
    console.log("销毁后")
  }
};
</script>
<style lang="less">
</style>
